﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess;
using BaseEntities;

namespace BusinessLogic
{
   public  class WithdrawLogic
    {
       public static decimal getBalance(Card cardNo)
       {
           return WithdrawDataAccess.getBalance(cardNo);
       }
       public static bool CheckWithdrawCash(decimal amount, Card cardNo)
       {
           return WithdrawDataAccess.CheckWithdrawCash(amount,cardNo);
       }
       public static bool CheckCashWithMinMaxValue(decimal amount, Card cardNo)
       {
           return WithdrawDataAccess.CheckCashWithMinMaxValue(amount,cardNo);
       }
       public static bool CheckCashWithMod(decimal amount, Card cardNo)
       {
           return WithdrawDataAccess.CheckCashWithMod(amount,cardNo);
       }
       // kiểm tra số tiền trong cây ATM
       public static decimal GetAllMoney()
       {
           return WithdrawDataAccess.GetAllMoney();
       }
       // cập nhật lại số dư tài khoản
       public static bool UpdateBalance(decimal amount, Card cardNo, Account accountID)
       {
           if (WithdrawDataAccess.UpdateBalance(amount, cardNo, accountID))
               return true;
           else
               return false;
       }
       // ghi lich su
       public static bool WriteLog(Log log)
       {
           if (WithdrawDataAccess. WriteLog(log) == true)
               return true;
           return false;
       }
    }
}
